<?php

function smarty_function_gen_listingtab_row($params, &$smarty)
{
    $ConfFields = &$params['ConfFields'];
    $CONFIG = &$params['Config'];
    $Item = &$params['Item'];
    foreach($ConfFields as $name => $field)
    {
      if($field['useInList'] != '')
      {
        $str .= '<td>{include file="admin.field_'.((!isBlank($field['inListEdit'])) ? $field['inListEdit'] : 'value').'.tpl" Field=`$ConfFields.'.$name.'` Item=$curr}</td>';
        $ConfFields[$name]['name'] = $name;
        if(!isBlank($ConfFields[$name]['defaultValue']) && isBlank($Item[$name]))
        {
          $ConfFields[$name]['value'] = $ConfFields[$name]['defaultValue'];
        }
        else
        {
          $ConfFields[$name]['value'] = $Item[$name];
        }
      }
    }
    $smarty->assign_by_ref("ConfFields", $ConfFields);
    if($params['assign'] != '')
    {
      $smarty->assign_by_ref($params['assign'], $str);
    }
    else
    {
     echo $str;
    }
}
?>